x86/pv: Prune include lists
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 5 May 2020 10:27:22 +0000 (11:27 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 5 May 2020 14:25:04 +0000 (15:25 +0100)
Several of these in particular haven't been pruned since the logic was all
part of arch/x86/traps.c

Some adjustments to header files are required to avoid compile errors:
 * emulate.h needs xen/sched.h because gdt_ldt_desc_ptr() uses v->vcpu_id.
 * mmconfig.h needs to forward declare acpi_table_header.
 * shadow.h and trace.h need to have uint*_t in scope before including the Xen
   public headers.  For shadow.h, reorder the includes.  For trace.h, include
   types.h

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/pv/callback.c
xen/arch/x86/pv/emul-gate-op.c
xen/arch/x86/pv/emul-inv-op.c
xen/arch/x86/pv/emul-priv-op.c
xen/arch/x86/pv/emulate.h
xen/arch/x86/pv/ro-page-fault.c
xen/arch/x86/pv/shim.c
xen/arch/x86/x86_64/mmconfig.h
xen/include/asm-x86/shadow.h
xen/include/xen/trace.h

index 106c16ed0138328fe89e7e544e6c8400a2a1abad..97242cd3d48c5154fd8c00468e3cf03d74f7f462 100644 (file)
 #include <xen/event.h>
 #include <xen/hypercall.h>
 #include <xen/guest_access.h>
-#include <xen/lib.h>
-#include <xen/sched.h>
 #include <compat/callback.h>
 #include <compat/nmi.h>
 
-#include <asm/current.h>
-#include <asm/nmi.h>
 #include <asm/shared.h>
-#include <asm/traps.h>
 
 #include <public/callback.h>
 
index 3c7f6d70bc0e502d4b3268825b15dc074d7dbed7..61e65ce5213ac25e61183365c79dbad5ef6257da 100644 (file)
  */
 
 #include <xen/err.h>
-#include <xen/errno.h>
-#include <xen/event.h>
-#include <xen/guest_access.h>
-#include <xen/iocap.h>
-#include <xen/spinlock.h>
-#include <xen/trace.h>
-
-#include <asm/apic.h>
-#include <asm/debugreg.h>
-#include <asm/hpet.h>
-#include <asm/hypercall.h>
-#include <asm/mc146818rtc.h>
-#include <asm/p2m.h>
-#include <asm/pv/traps.h>
-#include <asm/shared.h>
-#include <asm/traps.h>
-#include <asm/x86_emulate.h>
-
-#include <xsm/xsm.h>
 
 #include "emulate.h"
 
index 91d05790c2fc62551cdbe8a61a14b98783daedf5..59e3edc8c420bcca478f885585e4c1c9d4438bed 100644 (file)
  * along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <xen/errno.h>
-#include <xen/event.h>
-#include <xen/guest_access.h>
-#include <xen/iocap.h>
-#include <xen/spinlock.h>
 #include <xen/trace.h>
 
-#include <asm/apic.h>
-#include <asm/debugreg.h>
-#include <asm/hpet.h>
-#include <asm/hypercall.h>
-#include <asm/mc146818rtc.h>
-#include <asm/p2m.h>
-#include <asm/pv/traps.h>
-#include <asm/shared.h>
-#include <asm/traps.h>
-#include <asm/x86_emulate.h>
-
-#include <xsm/xsm.h>
-
 #include "emulate.h"
 
 static int emulate_forced_invalid_op(struct cpu_user_regs *regs)
index e24b84f46aa6d789fb0f2815b50a26d81be56545..3b705299cf8eee0c68ac8b6138695e08bff04da8 100644 (file)
  * along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <xen/errno.h>
+#include <xen/domain_page.h>
 #include <xen/event.h>
 #include <xen/guest_access.h>
 #include <xen/iocap.h>
-#include <xen/spinlock.h>
-#include <xen/trace.h>
 
 #include <asm/amd.h>
-#include <asm/apic.h>
 #include <asm/debugreg.h>
 #include <asm/hpet.h>
 #include <asm/hypercall.h>
 #include <asm/mc146818rtc.h>
-#include <asm/p2m.h>
 #include <asm/pv/domain.h>
-#include <asm/pv/traps.h>
 #include <asm/shared.h>
-#include <asm/traps.h>
-#include <asm/x86_emulate.h>
 
 #include <xsm/xsm.h>
 
index fd2aa0a4848c9fec685ae3233e79e6ca079a25e7..4b845b08e37202c56d5d4d60a01d03b7c7701584 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __PV_EMULATE_H__
 #define __PV_EMULATE_H__
 
+#include <xen/sched.h>
+
 #include <asm/processor.h>
 #include <asm/x86_emulate.h>
 
index a920fb5e150dba07b9a07f2b17754f3fe740be73..0eedb70002f1f828f0481f43a330d42d213f8ac5 100644 (file)
  * along with this program; If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <xen/guest_access.h>
-#include <xen/rangeset.h>
-#include <xen/sched.h>
 #include <xen/trace.h>
-
-#include <asm/domain.h>
-#include <asm/mm.h>
-#include <asm/pci.h>
-#include <asm/pv/mm.h>
 #include <asm/shadow.h>
 
 #include "emulate.h"
index 31264582cc1bcc522473c6fa1c31515f0e4c087e..3a0525c209ee4db03434f00ce10ac830a3af9149 100644 (file)
 #include <xen/iocap.h>
 #include <xen/param.h>
 #include <xen/shutdown.h>
-#include <xen/types.h>
 #include <xen/consoled.h>
 #include <xen/pv_console.h>
 
-#include <asm/apic.h>
 #include <asm/dom0_build.h>
 #include <asm/guest.h>
-#include <asm/pv/mm.h>
 
 #include <public/arch-x86/cpuid.h>
 #include <public/hvm/params.h>
index 2e836848ad4fcb30c3a3c470714c5c5ef4d3a61d..4d3b9fcbdd3ce7dccf69b667cbd301077fbe19c2 100644 (file)
@@ -75,6 +75,7 @@ static inline void mmio_config_writel(void __iomem *pos, u32 val)
 }
 
 /* function prototypes */
+struct acpi_table_header;
 int acpi_parse_mcfg(struct acpi_table_header *header);
 int pci_mmcfg_reserved(uint64_t address, unsigned int segment,
                        unsigned int start_bus, unsigned int end_bus,
index 907c71f497e7091b9df6f2bfdb97a5d5c237460a..8335862c87b7badb07f75e796cc2cd85708e63f9 100644 (file)
@@ -22,7 +22,6 @@
 #ifndef _XEN_SHADOW_H
 #define _XEN_SHADOW_H
 
-#include <public/domctl.h>
 #include <xen/sched.h>
 #include <xen/perfc.h>
 #include <xen/domain_page.h>
@@ -31,6 +30,8 @@
 #include <asm/p2m.h>
 #include <asm/spec_ctrl.h>
 
+#include <public/domctl.h>
+
 /*****************************************************************************
  * Macros to tell which shadow paging mode a domain is in*/
 
index af925bcfcce49e40d98af0b624357987f1a61d0e..3cbb542af88848a02c83b4c856ea68bc8f6ae7f6 100644 (file)
@@ -28,6 +28,7 @@ extern int tb_init_done;
 #define tb_init_done false
 #endif
 
+#include <xen/types.h>
 #include <public/sysctl.h>
 #include <public/trace.h>
 #include <asm/trace.h>